/**
 * 
 */
package br.srv.full.virtual.entities.faces;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * @author Delfino
 * 
 */
@Entity
@DiscriminatorColumn(name = "membertype", discriminatorType = DiscriminatorType.CHAR)
@DiscriminatorValue(value = "F")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "facesmember", 
		uniqueConstraints = {
			@UniqueConstraint(columnNames = {"membertype", "name"})})
public abstract class FacesMember implements Serializable {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id")
	private Integer id;
	
	@Column(length = 50)
	private String name;

	private String description;

	/**
	 * @param p_name
	 */
	protected FacesMember(String p_name) {
		setName(p_name);
	}

	/**
	 * 
	 */
	protected FacesMember() {
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param p_name
	 *            the name to set
	 */
	public void setName(String p_name) {
		name = p_name;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param p_description
	 *            the description to set
	 */
	public void setDescription(String p_description) {
		description = p_description;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return getName();
	}
}
